package com.yzpc.service.Impl;

import com.yzpc.entity.User;
import com.yzpc.mapper.UserMapper;
import com.yzpc.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IUserServiceImpl implements IUserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User login(User user) {
        return userMapper.findUserByLogin(user);
    }

    @Override
    public int insertUser(User user) {
        return userMapper.insertUser(user);
    }

    @Override
    public int updateUserById(User user) {
        return userMapper.updateUserById(user);
    }

    @Override
    public int updateUserByName(User user) {
        return userMapper.updateUserByName(user);
    }

    @Override
    public void deleteUserById(Integer userId) {
        userMapper.deleteUserById(userId);
    }

    @Override
    public void deleteUserByName(String userName) {
        userMapper.deleteUserByName(userName);
    }

    @Override
    public List<User> findUserList(User user) {
        return userMapper.findUserList(user);
    }

    @Override
    public User findUserById(Integer userId) {
        return userMapper.findUserById(userId);
    }

    @Override
    public User findUserByName(String userName) {
        return userMapper.findUserByName(userName);
    }
}
